﻿using System;
using System.Collections.Generic;
using System.Text;
using DataAccess;
using System.Data;
using Entity;

namespace BusinessObject
{
    public class LinkWebBO
    {
        LinkWebDA lDA = new LinkWebDA();

        public DataSet getLinkWeb()
        {
            DataSet dt = lDA.getLinkWeb();
            return dt;
        }

        public bool createLinkWeb(string name, string site)
        {
            LinkWeb lw = new LinkWeb();
            lw.LinkWebName = name;
            lw.LinkWebSite = site;
            if (lDA.CreateLinkWeb(lw))
            {
                return true;
            }
            return false;
        }

        public LinkWeb selectLinkWebById(int id)
        {
            LinkWeb lw = lDA.getLinkWebById(id);
            return lw;
        }

        public bool updateLinkWeb(LinkWeb lw)
        {
            if (lDA.UpdateLinkWeb(lw))
            {
                return true;
            }
            return false;
        }

        public bool removeLinkWeb(LinkWeb lw)
        {
            if (lDA.DeleteLinkWeb(lw))
            {
                return true;
            }
            return false;
        }

        public DataSet phanTrangGreenLife(int currPage, int recodperpage, int Pagesize)
        {
            DataSet dt = lDA.PhanTrangGreenLife(currPage, recodperpage, Pagesize);
            return dt;
        }
    }
}
